package com.zxx.pullRefresh;

import com.zxx.pullRefresh.PullToRefreshLayout.OnRefreshListener;

import android.os.Handler;
import android.os.Message;

/**
 * @brief 自定义控件刷新监听器
 * @author zxx
 *
 */
public class MyListener implements OnRefreshListener
{

	@Override
	public void onRefresh(final PullToRefreshLayout pullToRefreshLayout)//刷新操作，继承重写时候需要记得调用父类刷新控件
	{
		new Handler()
		{
			@Override
			public void handleMessage(Message msg)
			{
				
				pullToRefreshLayout.refreshFinish(pullToRefreshLayout.SUCCEED);
			}
		}.sendEmptyMessageDelayed(0, 5000);
	}

	@Override
	public void onLoadMore(final PullToRefreshLayout pullToRefreshLayout)//加载操作，继承重写时候需要记得调用父类刷新控件
	{

		new Handler()
		{
			@Override
			public void handleMessage(Message msg)
			{
				
				pullToRefreshLayout.loadmoreFinish(pullToRefreshLayout.SUCCEED);
			}
		}.sendEmptyMessageDelayed(0, 5000);
	}

}
